package com.example.mapper;

import com.example.entity.hz.Workflowdocument;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.hz.Workflowdocumentpersonconfig;
import com.example.entity.vo.WorkflowDocumentHisVo;
import com.example.entity.vo.WorkflowDocumentVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Lan
 * @since 2025-01-03
 */
public interface WorkflowdocumentMapper extends BaseMapper<Workflowdocument> {

    @Select("SELECT h.*,d.workflowConfigNo,d.workflowConfigName,d.reporterNo,d.reporterName,d.remark,d.createTime,d.creatorName FROM WorkflowDocumentHis h " +
            "LEFT JOIN WorkflowDocument d on h.workflowDocumentID = d.workflowDocumentID WHERE h.approverNo = #{approverNo}")
    List<WorkflowDocumentHisVo> selectHis(String approverNo);

    List<WorkflowDocumentVo> selectUnderReview(String approverNo);

    List<Workflowdocumentpersonconfig> getNowUser(String id, String level);

    Workflowdocument getByConfigAndDocument(String workflowConfigNo, String documentNo);
}
